﻿package {

import pete.forms.Pattern;
import flash.display.BlendMode;
import flash.display.LoaderInfo;
import flash.display.Sprite;

		
	
public class DocumentClass extends Sprite {
	
	// Properties
	// -----------------------------------------------------------
	
	private var colorbar:ColorBar;
	private var flupal:Flupal;
	
	
	
	// Constructor
	// -----------------------------------------------------------
	
	public function DocumentClass() {
		
		var so:Object 			= LoaderInfo(loaderInfo).parameters;
		
		var pattern:Pattern	 		= new Pattern();
		pattern.setSize			(2880, 25);
		pattern.draw				(so.themePath + "/images/colorbar-texture.gif");
		
		colorbar 				= new ColorBar();
		colorbar.setTitle 			("Digital FX");
		colorbar.setTexture			(pattern);
		
		addChild				(colorbar);
		
		flupal					= new Flupal();
		flupal.request			("menu.getLinks", loadPrimaryMenu, 6);
	}
	
	
	
	// Event Handlers
	// -----------------------------------------------------------
	
	private function loadPrimaryMenu($menu:Object):void {
		
		var index:int = 0;
		
		for (var i:String in $menu) {
			
			if ($menu[i] != null) {
				
				colorbar.setTab(index, $menu[i]);
				index++;
			}
		}
	}
	
}
	
}